<%--                                                                       --%>
<%-- Copyright (c) 2001-2004 BroadVision, Inc.  All rights reserved.       --%>
<%--                                                                       --%>
<%-- This software is copyrighted. Under the copyright laws, this software --%>
<%-- may not be copied, in whole or in part, without prior written consent --%>
<%-- of BroadVision, Inc. or its assignees. This software is provided      --%>
<%-- under the terms of a license between BroadVision and the recipient,   --%>
<%-- and its use is subject to the terms of that license.                  --%>
<%--                                                                       --%>
<%-- This software may be protected by one or more U.S. and International  --%>
<%-- patents.  Certain applications of BroadVision One-To-One software are --%>
<%-- covered by U.S. patent 5,710,887.                                     --%>
<%--                                                                       --%>
<%-- TRADEMARKS: BroadVision and BroadVision One-To-One are registered     --%>
<%-- trademarks of BroadVision, Inc., in the United States and the         --%>
<%-- European Community, and are trademarks of BroadVision, Inc., in other --%>
<%-- countries.  The BroadVision logo, is a trademark of BroadVision,      --%>
<%-- Inc., in the United States and other countries. Additionally, IONA    --%>
<%-- and Orbix are trademarks of IONA Technologies, Ltd.  RSA, MD5, and    --%>
<%-- RC2 are trademarks of RSA Data Security, Inc.                         --%>
<%--                                                                       --%>


<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<script language="JavaScript">
function closeWindow() {
  self.close();
}

//
// A user has been selected. Pass the userAlias value back to
// the parent window's callback function 'setUserData()'. And then
// close the popup window.
//
function setUserData(formName, firstName, lastName, fullName, userAlias) {
  var theForm = document.forms[formName];
  var parentFormName = theForm.parentFormName.value;
  
  window.opener.setUserData(parentFormName, firstName, lastName, fullName, userAlias);
  window.close();
}


</script>

    <html:form action="/ca/userSearch.do"> 
      <html:hidden property="parentFormName"/>
      <input type="hidden" name="doSearch" value="true"/>
      
      <!-- Zone 5 starts here.  -->
      <table class="zoneFive" width="100%" border="0" cellspacing="0" cellpadding="0" summary="content area">
        <tr>
          <td valign="top" width="100%">
            <div class="generalWrapRight">
              <input type="button" class="inputButton" onclick="javascript:closeWindow()"
                     value='<bean:message bundle="appCommonRes" key="button.closewindow"/>'>
            </div> 
            
						<div class="blockWrap"> 
            <table class="labelForm" width="100%" border="0" cellspacing="0" 
                   cellpadding="2" summary="User search table">
              <tr> 
                <td width="10%" nowrap>
                  <b><bean:message bundle="appCommonRes" key="ca.searchUser"/></b>
                  <br>&nbsp;
                </td>
                <logic:equal name="caUserFindView" property="isUsingFMLName" value="true">
                  <td width="10%" nowrap>
                    <html:text property="firstName" size="20" maxlength="80" />
                    <br><i>(<bean:message bundle="appCommonRes" key="ca.firstName"/>)</i>
                  </td>
                  <td width="10%" nowrap>
                    <html:text property="lastName" size="20" maxlength="80" />
                    <br><i>(<bean:message bundle="appCommonRes" key="ca.lastName"/>)</i>
                  </td>
                </logic:equal>

                <logic:equal name="caUserFindView" property="isUsingFMLName" value="false">
                  <td width="10%" nowrap>
                    <html:text property="fullName" size="20" maxlength="80" />
                    <br><i>(<bean:message bundle="appCommonRes" key="ca.name"/>)</i>
                  </td>
                </logic:equal>
                <td width="10%" nowrap>
                  <html:text property="userAlias" size="20" maxlength="80"/>
		                <br><i>(<bean:message bundle="appCommonRes" key="ca.signInId"/>)</i>
                </td>
                <td width="60%" nowrap> 
                  <html:submit property="gotoBtn" styleClass="inputButton">
                    <bean:message bundle="appCommonRes" key="button.go"/>
                  </html:submit>
                  <br>&nbsp;
                </td>
              </tr>
            </table>
			      </div>
            <!-- Start Result List here -->
            
            <div class="app_pageSubtitle">
              <span class="left">
                <bean:message bundle="appCommonRes" key="ca.searchResults" />
              </span>
              <span class="right">&nbsp;</span>
            </div> 
            
						<div class="blockWrap">  
            <table class="dataTable" border="0" cellspacing="1" cellpadding="2" summary="Search result table" width="100%">
              <tr class="listHeader">
                <th id="Name" align="left"><bean:message key="cs.name"/></th>
                <th id="Id" align="left">
                  <bean:message bundle="appCommonRes" key="ca.signInId"/>
                </th>
                <th id="Actions" align="left" nowrap><bean:message key="cs.actions"/></th>
              </tr>

              <logic:empty name="caUserFindView" property="userList">
                <tr class="listEven">
                  <td colspan=3 align="center">
                    <bean:message bundle="appCommonRes" key="ca.noUser"/>
                  </td>
                </tr>
              </logic:empty>
              <logic:notEmpty name="caUserFindView" property="userList">
                <logic:iterate id="oneResult" name="caUserFindView" property="userList" indexId="index">
                  <tr class='<%= index.intValue() % 2 == 0 ? "listEven" : "listOdd"%>'>
                    <td headers="Name">
                      <bean:write name="oneResult" property="fullName" />
                    </td>
                    <td headers="Id">
                      <bean:write name="oneResult" property="userAlias"/>&nbsp;
                    </td>
                    <td nowrap align="left" headers="Actions">
                      
                      <a href="JavaScript:setUserData('caUserFindForm', '<bean:write name="oneResult" property="firstName"/>', '<bean:write name="oneResult" property="lastName"/>', '<bean:write name="oneResult" property="fullName"/>', '<bean:write name="oneResult" property="userAlias"/>')">
                        <html:img page="/ca/images/action/icon_add.gif" 
                                  width="15" height="15" border="0" 
                                  altKey="cs.image.alt.selectUser" titleKey="cs.image.alt.selectUser"/>
                      </a>
                    </td>
                  </tr>
                </logic:iterate>
              </logic:notEmpty>
            </table>
            <!--end result list here-->

            <div class="pageButtonWrap" align="right">
              <html:button property="cancelBtn" styleClass="pageButton" onclick="javascript:closeWindow()">
                <bean:message bundle="appCommonRes" key="button.cancel"/>
              </html:button>
            </div>
						</div> <!--end blockWrap-->
          </td>
        </tr>
      </table>
      <!--end zone 5 content here -->
    </html:form>

